﻿/* 
 * Since 2008 - 2012
 */
package com.hh.bss.auth.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.auth.dao.*;
import com.hh.bss.auth.entity.*;
import com.hh.bss.auth.service.*;
import com.hh.bss.auth.vo.query.*;
import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.util.*;



public class SystemUser extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;

	// alias
	public static final String TABLE_ALIAS = "SystemUser";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_ACCOUNT = "account";
	public static final String ALIAS_PASSWD = "passwd";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_BRANCH_NBR = "branchNbr";
	public static final String ALIAS_DEPT_ID = "deptId";
	public static final String ALIAS_TITLE = "title";
	public static final String ALIAS_STATUS = "status";
	public static final String ALIAS_NEED_CHECKIN = "needCheckin";
	public static final String ALIAS_TEL = "tel";
	public static final String ALIAS_MOBILE = "mobile";
	public static final String ALIAS_EMAIL = "email";
	public static final String ALIAS_EMAIL_PASSWD = "emailPasswd";
	public static final String ALIAS_MSN = "msn";
	public static final String ALIAS_COMMENT = "comment";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";

	// date formats
	public static final String USER_STATUS_NORMAL = "N";
	public static final String USER_STATUS_LOCK = "B";
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;

	// 可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	// columns START

	private java.lang.Integer id;
	@NotBlank
	@Length(max = 50)
	private java.lang.String account;
	@NotBlank
	@Length(max = 50)
	private java.lang.String passwd;
	@NotBlank
	@Length(max = 50)
	private java.lang.String name;
	private java.lang.String nameCn;

	@Length(max = 10)
	private java.lang.String branchNbr;
	@NotBlank
	@Length(max = 50)
	private java.lang.String deptId;
	private String titleIdString;
	private String branchCompanyIdString;
	/** 入职日期 */
	private Date hiredate;

	private java.util.Date createDt;
	@Length(max = 50)
	private java.lang.String modifier;

	private java.util.Date modifiedDt;
	// columns END

	private Integer branchCompanyId;

	private java.lang.Integer titleId;
	@NotBlank
	@Length(max = 2)
	private java.lang.String status;
	@Length(max = 1)
	private java.lang.String needCheckin;
	@Length(max = 50)
	private java.lang.String tel;
	@Length(max = 18)
	private java.lang.String mobile;
	@Email
	@Length(max = 50)
	private java.lang.String email;
	@Email
	@Length(max = 50)
	private java.lang.String emailPasswd;
	@Length(max = 100)
	private java.lang.String msn;
	@Length(max = 255)
	private java.lang.String comment;
	@Length(max = 50)
	private java.lang.String creator;

	private java.lang.String businessGroup;

	private java.lang.String businessLevel;

	private String titleNameEn;

	private String titleName;

	public java.lang.String getNameCn() {
		return nameCn;
	}

	public void setNameCn(java.lang.String nameCn) {
		this.nameCn = nameCn;
	}
  
	public String getHiredateString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}

	public void setHiredateString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT, java.util.Date.class));
	}
	public Date getHiredate() {
		return hiredate;
	}

	public void setHiredate(Date hiredate) {
		this.hiredate = hiredate;
	}

	public String getTitleIdString() {
		return titleIdString;
	}

	public void setTitleIdString(String titleIdString) {
		this.titleIdString = titleIdString;
	}

	public String getBranchCompanyIdString() {
		return branchCompanyIdString;
	}

	public void setBranchCompanyIdString(String branchCompanyIdString) {
		this.branchCompanyIdString = branchCompanyIdString;
	}

	public String getTitleNameEn() {
		return titleNameEn;
	}

	public void setTitleNameEn(String titleNameEn) {
		this.titleNameEn = titleNameEn;
	}

	public java.lang.String getBusinessLevel() {
		return businessLevel;
	}

	public void setBusinessLevel(java.lang.String businessLevel) {
		this.businessLevel = businessLevel;
	}

	public java.lang.String getBusinessGroup() {
		return businessGroup;
	}

	public void setBusinessGroup(java.lang.String businessGroup) {
		this.businessGroup = businessGroup;
	}

	public String getTitleName() {
		return titleName;
	}

	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}

	public Integer getBranchCompanyId() {
		return branchCompanyId;
	}

	public void setBranchCompanyId(Integer branchCompanyId) {
		this.branchCompanyId = branchCompanyId;
	}

	public SystemUser() {
	}

	public SystemUser(java.lang.Integer id) {
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}

	public java.lang.Integer getId() {
		return this.id;
	}

	public void setAccount(java.lang.String value) {
		this.account = value;
	}

	public java.lang.String getAccount() {
		return this.account;
	}

	public void setPasswd(java.lang.String value) {
		this.passwd = value;
	}

	public java.lang.String getPasswd() {
		return this.passwd;
	}

	public void setName(java.lang.String value) {
		this.name = value;
	}

	public java.lang.String getName() {
		return this.name;
	}

	public void setBranchNbr(java.lang.String value) {
		this.branchNbr = value;
	}

	public java.lang.String getBranchNbr() {
		return this.branchNbr;
	}

	public void setDeptId(java.lang.String value) {
		this.deptId = value;
	}

	public java.lang.String getDeptId() {
		return this.deptId;
	}

	public java.lang.Integer getTitleId() {
		return titleId;
	}

	public void setTitleId(java.lang.Integer titleId) {
		this.titleId = titleId;
	}

	public void setStatus(java.lang.String value) {
		this.status = value;
	}

	public java.lang.String getStatus() {
		return this.status;
	}

	public void setNeedCheckin(java.lang.String value) {
		this.needCheckin = value;
	}

	public java.lang.String getNeedCheckin() {
		return this.needCheckin;
	}

	public void setTel(java.lang.String value) {
		this.tel = value;
	}

	public java.lang.String getTel() {
		return this.tel;
	}

	public void setMobile(java.lang.String value) {
		this.mobile = value;
	}

	public java.lang.String getMobile() {
		return this.mobile;
	}

	public void setEmail(java.lang.String value) {
		this.email = value;
	}

	public java.lang.String getEmail() {
		return this.email;
	}

	public void setEmailPasswd(java.lang.String value) {
		this.emailPasswd = value;
	}

	public java.lang.String getEmailPasswd() {
		return this.emailPasswd;
	}

	public void setMsn(java.lang.String value) {
		this.msn = value;
	}

	public java.lang.String getMsn() {
		return this.msn;
	}

	public void setComment(java.lang.String value) {
		this.comment = value;
	}

	public java.lang.String getComment() {
		return this.comment;
	}

	public void setCreator(java.lang.String value) {
		this.creator = value;
	}

	public java.lang.String getCreator() {
		return this.creator;
	}

	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}

	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT, java.util.Date.class));
	}

	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}

	public java.util.Date getCreateDt() {
		return this.createDt;
	}

	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}

	public java.lang.String getModifier() {
		return this.modifier;
	}

	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}

	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT, java.util.Date.class));
	}

	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}

	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	private Set systemUserRoless = new HashSet(0);

	public void setSystemUserRoless(Set systemUserRoles) {
		this.systemUserRoless = systemUserRoles;
	}

	public Set getSystemUserRoless() {
		return systemUserRoless;
	}

	private Set systemUserAcls = new HashSet(0);

	public void setSystemUserAcls(Set systemUserAcl) {
		this.systemUserAcls = systemUserAcl;
	}

	public Set getSystemUserAcls() {
		return systemUserAcls;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("Id", getId()).append("Account", getAccount()).append("Passwd", getPasswd()).append("Name", getName()).append("BranchNbr", getBranchNbr()).append("DeptId", getDeptId())

		.append("Status", getStatus()).append("NeedCheckin", getNeedCheckin()).append("Tel", getTel()).append("Mobile", getMobile()).append("Email", getEmail()).append("EmailPasswd", getEmailPasswd()).append("Msn", getMsn()).append("Comment", getComment()).append("Creator", getCreator()).append("CreateDt", getCreateDt()).append("Modifier", getModifier()).append("ModifiedDt", getModifiedDt()).toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getId()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof SystemUser == false)
			return false;
		if (this == obj)
			return true;
		SystemUser other = (SystemUser) obj;
		return new EqualsBuilder().append(getId(), other.getId()).isEquals();
	}
}
